<?php
/*由bean脚本生成 powerBy--joe*/
namespace app\common\validate;

use app\common\bean\ContentBean;

class ContentValidate extends BaseValidate
{

	static $all = 'all';
	static $add = 'add';
	static $edit = 'edit';
	static $pkId = 'id';

	public function __construct(array $rules = [], array $message = [], array $field = [])
	{
		parent::__construct($rules, $message, $field);
		$this->rule = [
			 ContentBean::$id => 'require', //
			 ContentBean::$storeId => 'require', //
			 ContentBean::$type => 'require', //类型（1、洗照片，2证件照，3打印）
			 ContentBean::$icon => 'require|max:255', //小图标
			 ContentBean::$pic => 'require|max:255', //详情上图
			 ContentBean::$content => 'require', //内容
			 ContentBean::$updatedAt => 'require', //
			 ContentBean::$createdAt => 'require', //
		];
		$this->message = [
			ContentBean::$id.POINST."require " => 'id必须', //
			ContentBean::$storeId.POINST."require " => 'store_id必须', //
			ContentBean::$type.POINST."require " => 'type必须', //类型（1、洗照片，2证件照，3打印）
			ContentBean::$icon.POINST."require " => 'icon必须', //小图标
			ContentBean::$pic.POINST."require " => 'pic必须', //详情上图
			ContentBean::$content.POINST."require " => 'content必须', //内容
			ContentBean::$updatedAt.POINST."require " => 'updated_at必须', //
			ContentBean::$createdAt.POINST."require " => 'created_at必须', //
		];
		$this->scene = [
			self::$all => [
				ContentBean::$id,
				ContentBean::$storeId,
				ContentBean::$type,
				ContentBean::$icon,
				ContentBean::$pic,
				ContentBean::$content,
				ContentBean::$updatedAt,
				ContentBean::$createdAt,
			],
			self::$add => [
				ContentBean::$storeId,
				ContentBean::$type,
				ContentBean::$icon,
				ContentBean::$pic,
				ContentBean::$content,
			],
			self::$edit => [
				ContentBean::$id,
				ContentBean::$storeId,
				ContentBean::$pic,
				ContentBean::$content,
			],
			self::$pkId => [ContentBean::$id],
		];
	}


}
